package weixinkeji.dev.dc.base.food.sql;

import sys.wx.ann.AF;
import weixinkeji.dev.dc.base.food.bean.Food;
import weixinkeji.dev.dc.base.food.bean.Series;
import weixinkeji.dev.dc.base.unit.bean.Unit;

/**
 *
 * @author IMY
 */
public class FoodSQL {

    /**
     * Food表别名：F<P>
     * Unit表别名：U<P>
     * Series表别名：S
     */
    public static final String FOOD_VIEW;

    static {
        sys.wx.ann.tc.bean.objectTC.TC U = AF.getTC(Unit.class);
        sys.wx.ann.tc.bean.objectTC.TC S = AF.getTC(Series.class);
        FOOD_VIEW = "SELECT F.*,U.unit_name,S.series_name FROM " + AF.getTC(Food.class).talbeName + " AS F"
                + " LEFT JOIN " + U.talbeName + " AS U ON F." + U.mID.tcName + "=U." + U.mID.tcName
                + " LEFT JOIN " + S.talbeName + " AS S ON F." + S.mID.tcName + "=S." + S.mID.tcName + " ";
    }
}
